<template>
	<view class="main_bg">
		<app-headerIndex title="个人中心" :isBack="false"></app-headerIndex>
		<view class="account_bg">
			<view class="top">
				<view class="head flex-s">
					<view class="avatar flex-c">
						<u-avatar :src="userInfo.avatar" size="104rpx"></u-avatar>
						<view class="name">{{userInfo.name}}</view>
					</view>
					<view class="setting" @click="$func.toUrl('/pages/setting/setting')">
						<u-icon name="setting" size="36rpx"></u-icon>
					</view>
				</view>
				<view class="total flex-c">
					<view class="total_son flex-c">
						<view class="num">{{userInfo.device_count}}</view>
						<view class="name flex-c">
							<view class="icon flex-c">
								<u-image src="/static/images/user_01.png" mode="aspectFit" width="28rpx"
									height="28rpx"></u-image>
							</view>
							设备总数
						</view>
					</view>
					<view class="total_son flex-c">
						<view class="num">{{userInfo.maintenance_count}}</view>
						<view class="name flex-c">
							<view class="icon flex-c">
								<u-image src="/static/images/user_02.png" mode="aspectFit" width="28rpx"
									height="28rpx"></u-image>
							</view>
							报修次数
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="tools flex-c">
			<view class="tools_son flex-c" @click="$func.toUrl('/pages_user/device/list')">
				<view class="icon flex-c">
					<u-image src="/static/images/user_01.png" mode="aspectFit" width="68rpx" height="68rpx"></u-image>
				</view>
				<view class="name">我的设备</view>
			</view>
			<view class="tools_son flex-c" @click="$func.toUrl('/pages_user/repair/add')">
				<view class="icon flex-c">
					<u-image src="/static/images/user_02.png" mode="aspectFit" width="68rpx" height="68rpx"></u-image>
				</view>
				<view class="name">设备报修</view>
			</view>
			<view class="tools_son flex-c" @click="$func.toUrl('/pages_user/repair/repair')">
				<view class="icon flex-c">
					<u-image src="/static/images/user_03.png" mode="aspectFit" width="68rpx" height="68rpx"></u-image>
				</view>
				<view class="name">报修记录</view>
			</view>
			<view class="tools_son flex-c" @click="$func.toUrl('/pages_user/inspections/inspection')"
				v-if="userInfo.type==1">
				<view class="icon flex-c">
					<u-image src="/static/images/user_04.png" mode="aspectFit" width="68rpx" height="68rpx"></u-image>
				</view>
				<view class="name">巡检计划</view>
			</view>
		<!-- 	<view class="tools_son flex-c" @click="$func.toUrl('/pages_user/repair/simple')">
				<view class="icon flex-c">
					<u-image src="/static/images/user_08.png" mode="aspectFit" width="68rpx" height="68rpx"></u-image>
				</view>
				<view class="name">简易报修记录</view>
			</view> -->
			<view class="tools_son flex-c" @click="$func.toUrl('/pages_user/filter/filter')">
				<view class="icon flex-c">
					<u-image src="/static/images/user_05.png" mode="aspectFit" width="68rpx" height="68rpx"></u-image>
				</view>
				<view class="name">故障排查</view>
			</view>
			<view class="tools_son flex-c" @click="$func.toUrl('/pages_user/feedback/feedback')">
				<view class="icon flex-c">
					<u-image src="/static/images/user_06.png" mode="aspectFit" width="68rpx" height="68rpx"></u-image>
				</view>
				<view class="name">意见反馈</view>
			</view>
			<button class="tools_son flex-c" open-type='contact'>
				<view class="icon flex-c">
					<u-image src="/static/images/user_07.png" mode="aspectFit" width="68rpx" height="68rpx"></u-image>
				</view>
				<view class="name">联系客服</view>
			</button>
		</view>
	</view>
</template>

<script>
	export default {

		data() {
			return {

			}
		},
		computed: {
			userInfo() {
				return this.$store.state.user.info
			}
		},
		created() {
			this.$store.dispatch("GetInfo")
		},
		methods: {


		}
	}
</script>

<style scoped lang="scss">
	.account_bg {
		height: 226rpx;
		background-color: #4F6FF6;
		padding: 20rpx;

		.top {
			font-size: 36rpx;
			height: 330rpx;
			background: rgba(255, 255, 255, 1);
			opacity: 1;
			border-radius: 10rpx;
			color: #333333;

			.head {
				padding: 36rpx;

				.name {


					margin-left: 10rpx;
				}
			}

			.total {
				padding: 0 36rpx;

				.total_son {
					flex: 1;
					flex-direction: column;

					.name {
						margin-top: 16rpx;
						color: #B4B4B4;
						font-size: 28rpx;

						.icon {
							background-color: #D8DFFF;
							width: 30rpx;
							height: 30rpx;
							border-radius: 50%;
							margin-right: 10rpx;
						}
					}

					&:nth-child(2) {
						border-left: 1px solid #D5DBDB;

						.name {
							.icon {
								background-color: #FFDFCD;
							}
						}
					}
				}

			}
		}
	}

	.tools {
		margin: 110rpx 20rpx 0;
		padding: 40rpx 0 0;
		background: rgba(255, 255, 255, 1);
		opacity: 1;
		border-radius: 10rpx;
		flex-wrap: wrap;
		justify-content: flex-start;

		.tools_son {
			width: 25%;
			flex-direction: column;
			padding-bottom: 36rpx;

			.icon {
				background-color: #4F6FF6;
				width: 68rpx;
				height: 68rpx;
				border-radius: 50%;
			}

			.name {
				margin-top: 18rpx;
				font-size: 28rpx;
				line-height: 28rpx;
				color: #B4B4B4;
			}

			&:nth-child(2) {
				.icon {
					background-color: #04BFA1;
				}
			}

			&:nth-child(3) {
				.icon {
					background-color: #F68C4F;
				}
			}

			&:nth-child(4) {
				.icon {
					background-color: #1F3BB3;
				}
			}

			&:nth-child(5) {
				.icon {
					background-color: #D90808;
				}
			}

			&:nth-child(6) {
				.icon {
					background-color: #04BFA1;
				}
			}

			&:nth-child(7) {
				.icon {
					background-color: #4F6FF6;
				}
			}
		}
	}

	.tools {
		button {
			background-color: rgba(255, 255, 255, 1);
			border: none;
			box-shadow: none;
			margin: 0;


			&::after {
				border: none;
			}
		}
	}
</style>